import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooCompanyController } from '../../../controllers';
const uctoocompanyRouter = new Router();
const companyController = new uctooCompanyController();

uctoocompanyRouter.post('/add', requireUser, companyController.add);
uctoocompanyRouter.post('/edit', requireUser, rowLevelPermission('uctoo/company'), companyController.edit);
uctoocompanyRouter.post('/del', requireUser, rowLevelPermission('uctoo/company'), companyController.delete);

//For getting company with permission control
uctoocompanyRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/company'), companyController.getSingle);
uctoocompanyRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/company'), companyController.getMany);
uctoocompanyRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/company'), companyController.getMany);

//#endregion AutoCreateCode
export default uctoocompanyRouter;
